package org.example;


import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

import static java.lang.Thread.sleep;

@Slf4j
public class LockSupportPark {
    public static void main(String[] args) throws Exception {


        Thread t1 = new Thread(() -> {
            try {
                sleep(2);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

            LockSupport.park();

        }, "t1");
        t1.start();



        LockSupport.unpark(t1);

    }


}

